package org.gjy.m8.date;

import org.junit.Test;

import java.time.Instant;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.time.temporal.WeekFields;
import java.util.Date;

/**
 * @author gjy
 * @version 1.0
 * @since 2024-02-29 14:47:33
 */
public class LocalTest {

    @Test
    public void test1() {
        int i = LocalDate.now().get(WeekFields.ISO.weekOfWeekBasedYear());
        System.out.println(i);
    }

    @Test
    public void test2() {
        Instant instant = new Date().toInstant();
        LocalDateTime localDate = instant.atZone(ZoneId.systemDefault()).toLocalDateTime();
        System.out.println(localDate);
    }

    @Test
    public void test3() {
        System.out.println(LocalDate.now().getDayOfYear());
    }
}
